home *** CD-ROM | disk | FTP | other *** search
/ Champak 40 / Vol 40.iso / games / ws_tetri.swf / scripts / %3Cdefault package%3E / WSsliderButton.as < prev   
Encoding:
Text File  |  2007-03-21  |  1.3 KB  |  45 lines

  1. function WSsliderButton()
  2. {
  3.    this.init();
  4. }
  5. WSsliderButton.prototype = new MovieClip();
  6. Object.registerClass("WSsliderButton",WSsliderButton);
  7. sb = WSsliderButton.prototype;
  8. sb.init = function()
  9. {
  10.    var _loc1_ = this;
  11.    _loc1_._x = _loc1_._parent.min0;
  12.    _loc1_.txt = 1;
  13.    _loc1_.minX = _loc1_._parent.bg._x;
  14.    _loc1_.maxX = _loc1_.minX + _loc1_._parent.bg._width;
  15.    _loc1_.minY = _loc1_.maxY = _loc1_._parent.bg._y;
  16.    _loc1_.txtFarbe = new Color(_loc1_.txt_over);
  17.    _loc1_.txtFarbe2 = new Color(_loc1_.txt_over2);
  18.    _loc1_.txtFarbeNormal = 26163;
  19.    _loc1_.txtFarbeOver = 10162381;
  20. };
  21. sb.onMouseDown = function()
  22. {
  23.    var _loc1_ = this;
  24.    var _loc3_ = _root._xmouse;
  25.    var _loc2_ = _root._ymouse;
  26.    if(_loc1_._parent.hitTest(_loc3_,_loc2_,false))
  27.    {
  28.       _loc1_.button_bg.gotoAndStop("over");
  29.       _loc1_.txtFarbe.setRGB(_loc1_.txtFarbeOver);
  30.       _loc1_.txtFarbe2.setRGB(_loc1_.txtFarbeOver);
  31.       _loc1_.onEnterFrame = function()
  32.       {
  33.          this._parent.einrasten();
  34.       };
  35.    }
  36. };
  37. sb.onMouseUp = function()
  38. {
  39.    var _loc1_ = this;
  40.    _loc1_.button_bg.gotoAndStop("normal");
  41.    _loc1_.txtFarbe.setRGB(_loc1_.txtFarbeNormal);
  42.    _loc1_.txtFarbe2.setRGB(_loc1_.txtFarbeNormal);
  43.    delete _loc1_.onEnterFrame;
  44. };
  45.